<?php 
$weekarr = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
$week = $weekarr[date("w")];
?>
<div id="intermediary" class="indexcontentdiv">
    <div class="positiondiv">
        <table>
            <tr>
                <td class="td-left">
                    <img src="<?=base_url()?>resource/img/home_ico.png" width="21" height="17">
                    Setting > <a href="<?=base_url()?>user/employee">Employee</a> > New Employee
                </td>
                <td class="td-right">
                    <img src="<?=base_url()?>resource/img/menu2.png" width="27" height="24">Today is <?=$week?>,<?=date('M d,Y')?>
                </td>
            </tr>
        </table>
    </div>
    <div class="input-div">
        <?php echo form_open('user/new_employee'); ?>
        <table>
            <tr><td></td><td><span class="err"><?=validation_errors();?></span></td></tr>
            <tr><td colspan="2"><h3>.Employee</h3></td></tr>
            <tr><td class="nametd">IC NO:</td><td><input type="text" name="sn"/></td></tr>
            <tr><td class="nametd">Name:</td><td><input type="text" name="name"/></td></tr>
            <tr>
                <td class="nametd">Department:</td>
                <td>
                    <select name="department" style="width:100px">
                        <option value="0">-select-
                        <option value="1">Office
                        <option value="2">Marketing
                        <option value="3">Logistics
                    </select>
                </td>
            </tr>
            <tr><td class="nametd">Position:</td><td><input type="text" name="position"/></td></tr>
            <tr>
                <td class="nametd">Work Pass Holder:</td><td>
                    <select name="workpassholder">
                        <option value="0">-select-
                        <option value="1">PR
                        <option value="2">EP
                        <option value="3">WP
                        <option value="4">SP
                        <option value="5">SC
                        <option value="6">DP
                    </select>
                </td>
            </tr>
            <tr><td class="nametd">Join Date:</td><td><input type="text" name="joindate" id="joindate" style="width:120px;"/></td></tr>
            <tr><td class="nametd">Birthday:</td><td><input type="text" name="birthday" id="birthday" style="width:120px;"/></td></tr>
            <tr><td class="nametd">User:</td><td>
                    <select name="userid" id="userid" style="width:120px;">
                        <?php foreach ($leisureuser as $value) { ?>
                        <option value="<?=$value['id']?>"><?=$value['username']?>
                        <?php }?>
                    </select>
                </td></tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" value="Save"/>
                    <input type="button" value="Reset"/>
                </td>
            </tr>
        </table>
        <?php echo form_close(); ?>
    </div>
</div>
<script>
$("input[type='button']").click(function(){
    $("input[name='username']").val('');
    $("input[name='password']").val('');
    $("#role").val(0);
});

$('#birthday').datetimepicker({
    format:"Y-m-d",      //格式化日期
    timepicker:false,    //关闭时间选项
});

$('#joindate').datetimepicker({
    format:"Y-m-d",      //格式化日期
    timepicker:false,    //关闭时间选项
});
</script>
　